<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人资料</title>
</head>
<body>
<div id="avatar"></div>
<div id="info"></div>
</body>
</html>
<script>
    fetch('/user/profile/avatar',{credentials:"include"}).then(res=>{
        return res.blob()
    }).then(blob=>{
        let img = document.createElement('img')
        img.setAttribute('src',URL.createObjectURL(blob))
        document.querySelector('#avatar').appendChild(img)
    })
    fetch('/user/profile/info',{credentials:"include"}).then(res=>{
        return res.json()
    }).then(json=>{
        let info = document.querySelector('#info')
        for(let record of Object.entries(json)){
            let temp = document.createElement('span')
            temp.innerText = record[0]+'=====>'+record[1]
            info.appendChild(temp)
        }
    })
</script>